<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    
    <% if @content_for_title %>
        <%= yield :title %>
    <% else %>
        <title>Rails Answers: <%= controller.action_name %></title>
    <% end %>
    
    <% if @content_for_style %>
      <%= yield :style %>
    <% else %>
      <%= stylesheet_link_tag 'scaffold', 'main' %>
    <% end%>
    
    <% # Include TinyMCE before other JS to avoid problems -%> 
    <%= javascript_include_tiny_mce_if_used %> 
    <%= javascript_include_tag 'tiny_mce/main_mce' if using_tiny_mce? %>    
    
    <% if yield :script %>
      <%= yield :script %>
    <% else %>
      <%= javascript_include_tag 'prototype' %>
    <% end%>
  </head>
<body align="center">
<div id="page">

    <div id="header">
        <div id="header_forum" ><%= link_to 'Rails Answers', :controller=>'questions', :action=>'index' %></div>
        <div id="header_slogan" ><%= link_to 'answers your questions !', :controller=>'questions', :action=>'index' %></div>
        <div id="header_helper">
            <% if session[:user] %>
                Hello, <%= h(session[:user][:login]) %>!
                &middot; <%= link_to 'Logout', :controller=>'user', :action=>'logout' %>
                &middot; <%= link_to 'Profile', :controller=>'user', :action=>'profile' %>
                &middot; <%= link_to 'Favorite', :controller=>'friends', :action=>'index' %>
            <% else %>
                Welcome!
                &middot; <%= link_to 'Login', :controller=>'user', :action=>'login' %>
                &middot; <%= link_to 'Sign Up', :controller=>'user', :action=>'signup' %>
            <% end %>
            &middot; <%= link_to 'Help', :controller=>'main', :action=>'help' %>
        </div>
    </div>

    <%= yield :top_menu %>
    
    <% for name in [:notice, :warning, :message] %>
        <% if flash[name] %>
            <%= "<div class = \"flash\" id=\"flash_#{name}\">#{flash[name]}</div>" %>
        <% end %>
    <% end %>  
    
    <div id="content">
        <%= yield %>
    </div>
    
    <div id="footer">
        <div>copyleft &copy; 2006 railsanswers </div>
    </div>
</div>
</body>
</html>